/*
 * testeInsertionSort.cpp
 *
 *  Created on: Sep 13, 2011
 *      Author: dgdiniz
 */

#include <iostream>
#include <stdio.h>
#include "sort/insertionSort.hpp"

using namespace std;



void    RunTests()
{
	int listToSortInt[10] = {5,3,9,7,1,2,6,8,4,0};
	string listToSortString[10] = {"Douglas", "Gisele", "casa", "maria", "amor", "moly", "Dream", "Loja", "carinho", "tudo"};

	cout << "Before Insertion Sort:  ";
	for (int i=0; i<10; i++)
		cout << " | " << listToSortInt[i];

	cout << endl;

	insertionSort(&listToSortInt[0], 10);

	cout << "After Insertion Sort:  ";
	for (int i=0; i<10; i++)
		cout << " | " << listToSortInt[i];

	cout << endl;



	cout << "\n\n\nBefore Insertion Sort:  ";
	for (int i=0; i<10; i++)
		cout << " | " << listToSortString[i];

	cout << endl;

	insertionSort(&listToSortString[0], 10);

	cout << "After Insertion Sort:  ";
	for (int i=0; i<10; i++)
		cout << " | " << listToSortString[i];

	cout << endl;



	cout << "\n\n\nBefore Insertion Sort Dec:  ";
	for (int i=0; i<10; i++)
		cout << " | " << listToSortInt[i];

	cout << endl;

	insertionSortDec(&listToSortInt[0], 10);

	cout << "After Insertion Sort Dec:  ";
	for (int i=0; i<10; i++)
		cout << " | " << listToSortInt[i];

	cout << endl;


}

void testerInsertionSort()
{
	cout << "\n\n\n\nTESTER-INSERTION-SORT ---  Testing Insertion Sort\n";
	RunTests();
	cout << "TESTER-INSERTION-SORT ---  FINISHED!\n\n\n\n";
}
